<template>
  <!-- 移动端容器 - 保持竖屏比例 -->
  <div class="mobile-container">

    <!-- 应用标题栏 -->
    <div class="app-header">
      <i class="fas fa-chevron-left back-icon"></i>
      <h1 class="title">邻里社区</h1>
      <div class="header-actions">
        <i class="fas fa-search"></i>
        <i class="fas fa-ellipsis-v"></i>
      </div>
    </div>

    <!-- 主内容区 -->
    <div class="app-content">
      <router-view></router-view>
    </div>

    <!-- 底部导航栏 -->
    <div class="tab-bar">
      <router-link to="/main/home" class="tab-item" active-class="active">
        <i class="fas fa-home"></i>
        <span>首页</span>
      </router-link>
      <router-link to="/main/message" class="tab-item" active-class="active">
        <i class="fas fa-comment-alt"></i>
        <span>消息</span>
        <span class="badge">3</span>
      </router-link>
      <router-link to="/main/shop" class="tab-item" active-class="active">
        <i class="fas fa-store"></i>
        <span>商城</span>
      </router-link>
      <router-link to="/main/mine" class="tab-item" active-class="active">
        <i class="fas fa-user"></i>
        <span>我的</span>
      </router-link>
    </div>
  </div>
</template>

<style scoped>
/* 移动端基础样式 */
.mobile-container {
  position: relative;
  width: 100%;
  max-width: 414px; /* 常见手机宽度 */
  height: 100vh;
  margin: 0 auto;
  background: #f5f5f5;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}


/* 应用标题栏 */
.app-header {
  height: 56px;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #3a7bd5;
  color: white;
}

.title {
  font-size: 18px;
  font-weight: 500;
  margin: 0;
}

.back-icon, .header-actions {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.header-actions {
  gap: 16px;
}

/* 主内容区 */
.app-content {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  background: white;
}

/* 底部导航栏 */
.tab-bar {
  height: 56px;
  display: flex;
  background: white;
  border-top: 1px solid #eee;
}

.tab-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #666;
  text-decoration: none;
  font-size: 12px;
  position: relative;
}

.tab-item i {
  font-size: 20px;
  margin-bottom: 4px;
}

.tab-item.active {
  color: #3a7bd5;
}

.badge {
  position: absolute;
  top: 4px;
  right: 20px;
  background: #ff4757;
  color: white;
  border-radius: 50%;
  width: 16px;
  height: 16px;
  font-size: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}
</style>
